#ifndef __UI_Thread__
#define __UI_Thread__

#include "wx/thread.h"
#include "wx/textctrl.h"
#include "wx/wx.h"
#include "Control_Pref.h"
#include "MyUI.h"
#include "ResultNotebook.h"
#include "EditNotebook.h"

class LoadEventData {
public:
	LoadEventData(ResultArray& array,MYSQL* mysql,wxString& query,int& type):array(array),mysql(mysql),query(query),type(type){}
public:
	MYSQL* mysql;
	ResultArray array;
	wxString query;
	int type;
};

typedef float (*fetch_callback)(ResultArray& array,MYSQL* mysql,wxString& query,wxStatusBar* s_bar,QueryResultList* resultList,QueryResult* cur,QueryResult* r);

class UIThread : public wxThread  
{
public:

	UIThread(QueryResultList* list,MYSQL* mysql,EditNotebook* editNotebook,const wxString query,QueryResult* cur,QueryResult* r,
			 ResultNotebook* result,wxStatusBar* s_bar,wxChoice* currentDbChoice,Edit* log,int& type,ResultArray& array,fetch_callback fc);
	virtual void *Entry();
    virtual void OnExit();

private:
	MyUI* ui;
	MYSQL* mysql;
	wxString query;
	QueryResultList* resultList;
	QueryResult* cur;
	QueryResult* r;
	ResultNotebook* result;
	EditNotebook* editNotebook;
	wxStatusBar* s_bar;
	wxChoice* currentDbChoice;
	Edit* log;
	int type;
	ResultArray array;
	fetch_callback fc;

};


#endif

